//
//  ViewController.m
//  WeChatActionSheet
//
//  Created by bhczmacmini on 17/2/15.
//  Copyright © 2017年 LW. All rights reserved.
//

#import "ViewController.h"
#import "LWWeChatActionSheet.h"

@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    NSArray *arr = @[ @"微信弹框",
                    @"微信弹框带有标题的",
                    @"微信弹框按钮设置特定按钮不能点击",
                    @"微信弹框按钮设置全不能点击"];
    cell.textLabel.text = arr[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
        {
            LWWeChatActionSheet *sheet = [[LWWeChatActionSheet alloc] initWithWeChatActionSheetCancelButtonTitle:@"取消" title:nil otherButtonTitles:[NSArray arrayWithObjects:@"拍照",@"选择照片",@"选择视频",@"选择照片和视频", nil] btnClickBlock:^(NSInteger buttonIndex) {
                NSLog(@"选择了第%ld个",buttonIndex);
            }];
            [sheet show];
        }
            break;
        case 1:
        {
            LWWeChatActionSheet *sheet = [[LWWeChatActionSheet alloc] initWithWeChatActionSheetCancelButtonTitle:@"取消" title:@"请选择下面的选项,我是自适应高度的，所以不必担心，字数多了就显示不全了，而且字体大小和颜色都可以随便设置的哦，包括下面的选项" otherButtonTitles:[NSArray arrayWithObjects:@"拍照",@"选择照片",@"选择视频",@"选择照片和视频", nil] btnClickBlock:^(NSInteger buttonIndex) {
                NSLog(@"选择了第%ld个",buttonIndex);
            }];
            [sheet show];
        }
            break;
        case 2:
        {
            LWWeChatActionSheet *sheet = [[LWWeChatActionSheet alloc] initWithWeChatActionSheetCancelButtonTitle:@"取消" title:@"微信弹框按钮设置特定按钮不能点击" otherButtonTitles:[NSArray arrayWithObjects:@"拍照(我不能点击)",@"选择照片",@"选择视频(我不能点击)",@"选择照片和视频", nil] btnClickBlock:^(NSInteger buttonIndex) {
                NSLog(@"选择了第%ld个",buttonIndex);
            }];
            [sheet WeChatBtnIndex:0 enabled:NO];
            [sheet WeChatBtnIndex:2 enabled:NO];
            [sheet show];
        }
            break;
        case 3:
        {
            LWWeChatActionSheet *sheet = [[LWWeChatActionSheet alloc] initWithWeChatActionSheetCancelButtonTitle:@"取消" title:@"微信弹框按钮设置全不能点击" otherButtonTitles:[NSArray arrayWithObjects:@"拍照",@"选择照片",@"选择视频",@"选择照片和视频", nil] btnClickBlock:^(NSInteger buttonIndex) {
                NSLog(@"选择了第%ld个",buttonIndex);
            }];
            [sheet WeChatBtnNotEnabled];
            //            [sheet WeChatBtnCanEnabled];//全部能点击
            [sheet show];
        }
            break;
            
        default:
            break;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
